package com.atguigu.structure.composite;

import java.util.ArrayList;
import java.util.List;

public abstract class EduComponent {
    protected String name;

    protected List<EduComponent> children=new ArrayList<>();

    public EduComponent(String name) {
        this.name = name;
    }

    protected void add(EduComponent component){
        throw new UnsupportedOperationException("不支持的操作");
    }

    protected void remove(EduComponent component){
        throw new UnsupportedOperationException("不支持的操作");
    }

    protected abstract void print();

}
